package org.emmannuel.virtues.client.panel;

import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.event.dom.client.ClickHandler;
import com.google.gwt.user.client.ui.Button;

public class VirtueClickHandlerImpl implements ClickHandler {

	AboutVirtuePanel avp = null;
	VirtuePanel vp = null;
	
	public VirtueClickHandlerImpl(VirtuePanel vp, AboutVirtuePanel avp) {
		this.avp = avp;
		this.vp = vp;
	}
	
	@Override
	public void onClick(ClickEvent event) {
		Button b = (Button)event.getSource();
		String s = b.getText();
		avp.setVisible(true);
		avp.showSelectedVirtue(vp.getVirtueByName(s));
	}

}
